﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Web;
using Aspose.Excel;
using Telerik.Web.UI;

/// <summary>
/// Summary description for BaseReportPage
/// </summary>
public class BaseReportPage : BasePage
{
	protected virtual bool ExportToExcel(string defaultFileName, RadGrid radGrid)
	{
		try
		{
			radGrid.ExportSettings.FileName = defaultFileName;
			radGrid.ExportSettings.IgnorePaging = true;
			radGrid.ExportSettings.ExportOnlyData = true;
			
			radGrid.MasterTableView.ExportToExcel();
			return true;
		}
		catch (Exception ex)
		{
			PALogManager.ExceptionLog(ex);
		}

		return false;

	}


	


	protected void radGrid_PageIndexChanged(object source, GridPageChangedEventArgs e)
	{
		Fill();
	}

	protected void radGrid_PageSizeChanged(object source, GridPageSizeChangedEventArgs e)
	{
		Fill();
	}
	
}